#include <bits/stdc++.h>
using namespace std;
#define int long long

const int mod = 1000000007;
int pows[10][10000010] = {};
char x[10000010];
signed main() {
    scanf("%s",x);
    int n = strlen(x);
    for(int i = 0;i <= 9; ++ i) {
        for(int j = 0;j <= n; ++ j) {
            if(j == 0) pows[i][j] = 1;
            else {
                pows[i][j] = (pows[i][j-1] * i) % mod;
            }
        }
    }
    int ans = 0;
    for(int i = n - 1;i >= 0; -- i) {
        ans += pows[x[i]-'0'][n - i];
        ans %= mod;
    }
    cout << ans;

    return 0;
}